package com.ruoyi.transaction.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.transaction.mapper.ProductSpecValueMapper;
import com.ruoyi.common.entity.TransactionEntity.ProductSpecValue;
import com.ruoyi.transaction.service.IProductSpecValueService;

/**
 * 商品规格值Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-08
 */
@Service
public class ProductSpecValueServiceImpl implements IProductSpecValueService 
{
    @Autowired
    private ProductSpecValueMapper productSpecValueMapper;

    /**
     * 查询商品规格值
     * 
     * @param id 商品规格值主键
     * @return 商品规格值
     */
    @Override
    public ProductSpecValue selectProductSpecValueById(Long id)
    {
        return productSpecValueMapper.selectProductSpecValueById(id);
    }

    /**
     * 查询商品规格值列表
     * 
     * @param productSpecValue 商品规格值
     * @return 商品规格值
     */
    @Override
    public List<ProductSpecValue> selectProductSpecValueList(ProductSpecValue productSpecValue)
    {
        return productSpecValueMapper.selectProductSpecValueList(productSpecValue);
    }

    /**
     * 新增商品规格值
     * 
     * @param productSpecValue 商品规格值
     * @return 结果
     */
    @Override
    public int insertProductSpecValue(ProductSpecValue productSpecValue)
    {
        productSpecValue.setCreateTime(DateUtils.getNowDate());
        return productSpecValueMapper.insertProductSpecValue(productSpecValue);
    }

    /**
     * 修改商品规格值
     * 
     * @param productSpecValue 商品规格值
     * @return 结果
     */
    @Override
    public int updateProductSpecValue(ProductSpecValue productSpecValue)
    {
        productSpecValue.setUpdateTime(DateUtils.getNowDate());
        return productSpecValueMapper.updateProductSpecValue(productSpecValue);
    }

    /**
     * 批量删除商品规格值
     * 
     * @param ids 需要删除的商品规格值主键
     * @return 结果
     */
    @Override
    public int deleteProductSpecValueByIds(Long[] ids)
    {
        return productSpecValueMapper.deleteProductSpecValueByIds(ids);
    }

    /**
     * 删除商品规格值信息
     * 
     * @param id 商品规格值主键
     * @return 结果
     */
    @Override
    public int deleteProductSpecValueById(Long id)
    {
        return productSpecValueMapper.deleteProductSpecValueById(id);
    }
}
